package com.fcat.common.user.service;

import com.alibaba.fastjson.JSONObject;
import com.fcat.common.user.entity.Certificate;
import com.fcat.common.user.entity.User;
import com.fcat.common.user.vo.AdminClient;
import com.fcat.common.user.vo.AdminClientRole;
import com.fcat.common.user.vo.UserVO;
import com.fcat.springboot.mybatis.service.TsuantoneBaseService;

import java.util.List;
import java.util.Map;
import java.util.Set;

public interface UserService extends TsuantoneBaseService<User> {

    Integer updateByUsername(User user);


    JSONObject updatePassword(String Authorization, String username, String password);

    JSONObject updateUser(String Authorization, JSONObject jsonObject);

    void updateCertificate(Certificate certificate, Long userId);

    JSONObject addUser(String Authorization, JSONObject jsonObject);

    JSONObject createUser(String Authorization, String password, User user, List<Long> longs);

    JSONObject createKeycloakUserPermission(String Authorization, String username, List<Long> roleIds,String keycloakId);

    String getKeycloakIdUserInfoByUsername(String Authorization, String username);

    String getToken(String mac, String username, String password);

    JSONObject login(String mac, String username, String password);

    List<AdminClient> getClientList(String Authorization);

    List<AdminClientRole> getAvalableListByClientId(String Authorization, String clientId, String userId);

    User getUserByUsername(String username);

    List<UserVO> getListByOrganizationId(Map<String, Object> map);

    UserVO getUserVOByUsername(Map<String, Object> map);

    UserVO getUserVOById(Map<String, Object> map);

    List<AdminClientRole> getListByClientId(String Authorization, String clientId);

    JSONObject delUserByKeycloakId(String authorization, User user);

    List<User> getListByRoleId(Long roleId);

    List<UserVO> getListByLike(Map<String, Object> map);

    JSONObject logout(String username, String token, int logoutMode);

    boolean clearAccessToken(String username);

    JSONObject registerUser(JSONObject jsonObject);

//    JSONObject delUserById(String authorization, Long id);

    Integer delById(Long id);

    boolean processLoginToken(String username, String token);

    JSONObject isAccessToken(String authorization);

}